package org.example.springboot.repository;

import org.example.springboot.entity.ChatMessage;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;

public interface ChatMessageRepository extends JpaRepository<ChatMessage, Long> {
    List<ChatMessage> findByFromUserIdAndToUserIdOrFromUserIdAndToUserIdOrderBySendTimeAsc(
        Long fromUserId1, Long toUserId1, Long fromUserId2, Long toUserId2
    );
    List<ChatMessage> findByFromUserIdOrToUserIdOrderBySendTimeAsc(Long fromUserId, Long toUserId);
} 